package com.zabra.zl.ui.runing;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zabra.zl.App;
import com.zabra.zl.R;
import com.zabra.zl.data.RunningListBean;

import java.util.ArrayList;
import java.util.List;

public class ItemAdp extends BaseQuickAdapter<RunningListBean.FlowsBean, BaseViewHolder> {

    public ItemAdp(int layoutResId, @Nullable List<RunningListBean.FlowsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, RunningListBean.FlowsBean item) {
        helper.setText(R.id.item_type, item.getType())
                .setText(R.id.item_date, item.getAddTime())
                .setText(R.id.item_money, item.getAmt());
        ImageView imageView = helper.getView(R.id.item_img);
        if (item.getAmt().contains("-")) {
            imageView.setImageResource(R.mipmap.running_jian);
        } else {
            imageView.setImageResource(R.mipmap.running_jia);
        }

    }
}
